using System;
using UnityEngine;

namespace Assets.Pixelation.Example.Scripts
{
	public class PointLight : MonoBehaviour
	{
		public float RSpeed;

		public float HSpeed;

		public float HAmplitude;

		public GameObject Child;

		private float _angle;

		private void Update()
		{
			UpdateRotation();
			UpdateHeight();
		}

		private void UpdateRotation()
		{
			base.transform.rotation *= Quaternion.AngleAxis(RSpeed * Time.deltaTime, Vector3.up);
		}

		private void UpdateHeight()
		{
			_angle += HSpeed * Time.deltaTime;
			float num = (float)Math.Sin(_angle);
			Vector3 localPosition = Child.transform.localPosition;
			localPosition.y = num * HAmplitude;
			Child.transform.localPosition = localPosition;
		}
	}
}
